function changeImage() {
	x = document.getElementById("demo") // 找到元素
	x.style.color = "#ff0000";
}

function load(id) {
	var ajax = new XMLHttpRequest();
	ajax.open('get', '/sc/list?id=' + id);
	ajax.send();
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4 && ajax.status == 200) {
			document.getElementById("content").innerHTML = ajax.responseText;
			console.log(ajax.responseText);
		}
	}
}

function loadByJquery(id) {
	$.ajax({
		type : "get",
		url : '/sc/listObj?id=' + id,
		data : {},
		contentType : "application/json; charset=utf-8",
		dataTpye : 'json',
		success : function(array) {
			var header = "";
			header += "<meta charset='utf-8' />"
			header += "<table width='250%' border='0' cellspacing='1' cellpadding='4'"
			header += "	bgcolor='#cccccc' class='tabtop13' align='center'>"
			header += "	<tr>"
			header += "		<th class='btbg biaoti'>姓名</th>"
			header += "		<th class='btbg biaoti'>性别</th>"
			header += "		<th class='btbg biaoti'>学号</th>"
			header += "		<th class='btbg biaoti'>软件工程</th>"
			header += "		<th class='btbg biaoti'>计算机</th>"
			header += "		<th class='btbg biaoti'>数据结构</th>"
			header += "		<th class='btbg biaoti'>项目管理</th>"
			header += "		<th class='btbg biaoti'>语文</th>"
			header += "		<th class='btbg biaoti'>高数</th>"
			header += "		<th class='btbg biaoti'>近代史</th>"
			header += "		<th class='btbg biaoti'>java</th>"
			header += "		<th class='btbg biaoti'>Unix</th>"
			header += "		<th class='btbg biaoti'>模电</th>"
			header += "	</tr>"
			$(array).each(function(n, json) {
				header += "	<tr>"
				header += "		<td th:text='${vas.name}'>" + json.name + "</td>"
				header += "		<td th:text='${vas.sex}'>" + json.sex + "</td>"
				header += "		<td th:text='${vas.snumber}'>" + json.snumber
						+ "</td>"
				header += "		<td th:text='${vas.chenji1}'>" + json.chenji1
						+ "</td>"
				header += "		<td th:text='${vas.chenji2}'>" + json.chenji2
						+ "</td>"
				header += "		<td th:text='${vas.chenji3}'>" + json.chenji3
						+ "</td>"
				header += "		<td th:text='${vas.chenji4}'>" + json.chenji4
						+ "</td>"
				header += "		<td th:text='${vas.chenji5}'>" + json.chenji5
						+ "</td>"
				header += "		<td th:text='${vas.chenji6}'>" + json.chenji6
						+ "</td>"
				header += "		<td th:text='${vas.chenji7}'>" + json.chenji7
						+ "</td>"
				header += "		<td th:text='${vas.chenji8}'>" + json.chenji8
						+ "</td>"
				header += "		<td th:text='${vas.chenji9}'>" + json.chenji9
						+ "</td>"
				header += "		<td th:text='${vas.chenji10}'>" + json.chenji10
						+ "</td>"
				header += "	</tr>"
			});

			header += "</table>"

			$("#content2").html(header);
		},
		error : function() {
			alert("出错了！！！");
		}
	});

}

//new Vue({
//			el : '#classlist',
//			data : {
//				sites : [{
//					name : '软件071',
//					classnum : 'CL001'
//				}, {
//					name : '软件072',
//					classnum : 'CL002'
//				}, {
//					name : '软件073',
//					classnum : 'CL003'
//				}]
//			}
//		})

new Vue({
			el : '#stulist',
			data : {
				sites : [],
				titles : {
					stu_name : "姓名",
					stu_sex : "性别",
					stu_num : "学号",
					stu_age : "年龄"
				},
				classList : [{
					name : '软件071',
					classnum : 'CL001'
				}, {
					name : '软件072',
					classnum : 'CL002'
				}, {
					name : '软件073',
					classnum : 'CL003'
				}]
			},
			created : function() {
				this.loadStudent();
			},
			methods:{
				loadStudent:function(id){
				var self = this;
				$.ajax({
					type : "get",
					url : '/sc/stuList?id=' + id,
					data : {},
					contentType : "application/json; charset=utf-8",
					dataTpye : 'json',
					success : function(array) {
						self.sites = array;
					}
				})
				}
			}
		})
